<?php

use Biz\service\course\Course as sCourse;
use Doraemon\tools\ActionLog;

class DetailAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_NOTHING;

    public function main()
    {
        $courseId = $this->getRequest()->getQuery('course_id', 0);
        $data = sCourse::getDetail($courseId, $this->uid);
        ActionLog::log($this->uid, ['course_id' => $courseId, 'is_buy' => $data ? $data['is_owner'] : 0], ActionLog::BIZ_COURSE_DETAIL);
        $this->setSuccess($data, self::API_CODE_SUCCES);
    }
}